package com.xnyzc.lhy.common.penum.vehicle;

/**
 * @Author: huxuekuo
 * @Date: 2019-08-10 09:56
 * @Description:
 */
public enum ECallVehType {

    expressTrain(0, "实时"), reservation(1, "预约"),
    call(2, "代叫"),
    meetAirport(3, "接机"), deliveryAirport(4, "送机"),
    meetStation(5, "接站"), deliveryStation(6, "送站");

    private Integer type;
    private String value;

    ECallVehType(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    public int getType() {
        return this.type;
    }

    public String getValue() {
        return this.value;
    }

    public static ECallVehType finaByType(Integer type) {
        ECallVehType eCallVehType;
        switch (type) {
            case 0:
                eCallVehType = ECallVehType.expressTrain;
                break;
            case 1:
                eCallVehType = ECallVehType.reservation;
                break;
            case 2:
                eCallVehType = ECallVehType.call;
                break;
            case 3:
                eCallVehType = ECallVehType.meetAirport;
                break;
            case 4:
                eCallVehType = ECallVehType.deliveryAirport;
                break;
            case 5:
                eCallVehType = ECallVehType.meetStation;
                break;
            case 6:
                eCallVehType = ECallVehType.deliveryStation;
                break;
            default:
                throw new IllegalArgumentException("未设置");
        }
        return eCallVehType;
    }

    public static String finaByValue(Integer type) {
        ECallVehType[] values = ECallVehType.values();
        for (ECallVehType value : values) {
            if (value.type.equals(type)) {
                return value.value;
            }
        }
        return "";
    }
}
